package com.ly.common.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 消息路由-枚举
 * @author luoyun
 * @Date: 2025/6/09 15:37
 * @Note:
 */
@Getter
@AllArgsConstructor
public enum MsgUrlEnum {
    /**
     * 默认通知
     */
    DEFAULT("default", "",""),
    /**
     * 班组类通知
     */
    EMP("emp", "",""),
    /**
     * 管理员工类通知
     */
    PNEL("pnel", "url",""),
    /**
     * 其他类通知配置
     */
    OTHER("other", "component","/emp/notics");

    String type;
    String openType;
    String openPage;

    /**
     * 获取对应的枚举
     * @param type
     * @return
     */
    public static MsgUrlEnum getByType(String type){
        MsgUrlEnum[] values = values();
        for (MsgUrlEnum value : values) {
            if(value.getType().equals(type)){
                return value;
            }
        }
        return DEFAULT;
    }
}
